
package models;
import java.util.List;

import play.*;
import play.db.jpa.*;

import javax.persistence.*;

import java.util.*;

@Entity
public class CommListRequests extends Model{
	
	public long requesterID;
	public long replierID;
	public long CommListId;
	
	public boolean isRejected = false;
	public boolean isAccepted=false;
	
	//aya marwan reqests
		 @ManyToMany  
		 (mappedBy = "requestsToJoinCommList", cascade=CascadeType.ALL)
		 public  List<RegisteredUser> RegisteredUsersToJoin;
		 
	
	public CommListRequests(long requesterID, long replierID, long CommListId) {
		this.requesterID = requesterID;
		this.replierID = replierID;
		this.CommListId = CommListId;
		this.save();
	}
	
	public void setAccepted(boolean isAccepted) {
		  this.isAccepted = isAccepted;
		  this.save();
		 }
	public void setRejected(boolean isRejected) {
		  this.isRejected = isRejected;
		  this.save();
		 }
	public long getCommListId() {
		  return CommListId;
		 }
}
